package cz.semjob.document.annotation;

import cz.semjob.document.annotation.metadata.Relation;

public class RelationAnnotation {

	private final Relation type;

	private final EntityAnnotation entity1;
	private final EntityAnnotation entity2;

	public RelationAnnotation(EntityAnnotation entity1,
			EntityAnnotation entity2, Relation type) {
		super();
		if (entity1 == null || entity2 == null) {
			throw new AssertionError("One of entities is null");
		}
		this.entity1 = entity1;
		this.entity2 = entity2;
		this.type = type;
	}

	public Relation getType() {
		return type;
	}

	public EntityAnnotation getEntity1() {
		return entity1;
	}

	public EntityAnnotation getEntity2() {
		return entity2;
	}

	@Override
	public String toString() {
		return "RelationAnnotation [type=" + type.getName() + ", entity1="
				+ entity1 + ", entity2=" + entity2 + "]";
	}

}
